#include<stdio.h>

int main()
{
	int a = 20;
	int b = 40;
	int n = 0;
	int c = 0;
	int d = 0;
	scanf_s("%d %d", &a, &b);
	c = a;
	b = d;
	if (c >= d)
	{
		while (b != 0)
		{
			n = a % b;
			a = b;
			b = n;
		}
		printf("最大公约数为:%d\n", a);
	}
	else if (c < d)
	{
		while (a != 0)
		{
			n = b % a;
			b = a;
			a = n;
		}
		printf("最大公约数为:%d\n", b);
	}
	return 0;
}